ajDBType function
Available since AlchemyJ v4.1
Description
The ajDBType function returns the database type of a given data source ID. The supported database types are Oracle, MySQL, MariaDB, PostgreSQL and MSSQL. Please take note that to run this function from Excel, you would need to create a new data source record in the data source configuration table in External Resources Configuration.
Syntax
ajDBType(data_source_id)
Argument Name | Argument Type | Description |
---|---|---|
data_source_id (Optional) | String | The data_source_id. If the data_source_id is not provided, it will use the default data source ID value "primary" in the Data Source Configuration table. |
The function will return:
1) Return Value: Data source type in String format.
2) Return Type: Single Value
Example
Before using ajDBRunSPToWorkbook, the database connection must be set up in the Data Source Connection in ##ExternalResources worksheet.
As you can see, a new data source record is created as shown above. The default data source ID value is "primary". The rest of the columns that are not shown in this screenshot are empty.
Before running this function point, you need to configure the Data Source ID in ##RestEndpointGroup worksheet or ##JavaApiClass.
Provide a value for parameter.
Since the data source ID is "primary", it is used as the input parameter of the ajDBType function. This function returns the result 'MySQL'.
Click here to download the use case workbooks for further reference.
Error Scenarios
It will return #VALUE! when missing any required parameter or mismatch parameter type. Besides, system will raise error for below scenario(s).
Error Scenario |
---|
Invalid data source id. |
External Resource Worksheet does not exist. |